﻿<caliburn:CaliburnApplication x:Class="GYMm.App"
                              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                              xmlns:Converters="using:Common.UI.Converters"
                              xmlns:caliburn="using:Caliburn.Micro"
                              xmlns:local="using:GYMm">
    <Application.Resources>
        <ResourceDictionary>

            <Converters:DateTimeToStringConverter x:Key="DateTimeToStringConverter" />
            <Converters:DateTimeDeltaConverter x:Key="DateTimeDeltaConverter" />
            <Converters:NullToCollapsedConverter x:Key="NullToCollapsedConverter" />
            <Converters:NullToVisibleConverter x:Key="NullToVisibleConverter" />

            <x:Double x:Key="SmallFontSize">13</x:Double>
            <x:Double x:Key="MiddleFontSize">18</x:Double>
            <x:Double x:Key="LargeFontSize">22</x:Double>
            <x:Double x:Key="SuperLargeFontSize">48</x:Double>

            <Color x:Key="GymDarkTurquoiseColor">#FF006A7A</Color>
            <Color x:Key="GymTurquoiseColor">#FF2CCFC8</Color>

            <SolidColorBrush x:Key="GymRed" Color="#FFFF1905" />
            <SolidColorBrush x:Key="GymBlue" Color="#FF00AEEF" />
            <SolidColorBrush x:Key="GymGreen" Color="#FF00BD62" />
            <SolidColorBrush x:Key="GymGray" Color="#FF515151" />
            <SolidColorBrush x:Key="GymLightGray" Color="#FFB8B8B8" />
            <SolidColorBrush x:Key="GymDarkTurquoise" Color="{StaticResource GymDarkTurquoiseColor}" />
            <SolidColorBrush x:Key="GymTurquoise" Color="{StaticResource GymTurquoiseColor}" />

            <Converters:BoolToObjectConverter x:Name="DirectBoolToVisibilityConverter"
                                              IfFalse="Collapsed"
                                              IfTrue="Visible" />
            <Converters:BoolToObjectConverter x:Name="ReverceBoolToVisibilityConverter"
                                              IfFalse="Visible"
                                              IfTrue="Collapsed" />

            <Converters:NumberToObjectConverter x:Name="ProgressToArrowPathConverter" Border="0">
                <Converters:NumberToObjectConverter.IfMore>M800,139.75 L860,79.75 L920,139.5 z</Converters:NumberToObjectConverter.IfMore>
                <Converters:NumberToObjectConverter.IfLess>M800.25,160.25 L920.5,159.75 L860.25,219.75 z</Converters:NumberToObjectConverter.IfLess>
            </Converters:NumberToObjectConverter>

            <Converters:NumberToObjectConverter x:Name="ProgressToBrushConverter"
                                                Border="0"
                                                IfLess="{StaticResource GymRed}"
                                                IfMore="{StaticResource GymGreen}" />

            <Converters:TextToUpperCaseConverter x:Name="TextToUpperCaseConverter" />

            <Style TargetType="TextBlock">
                <Setter Property="FontWeight" Value="ExtraLight" />
            </Style>

            <Style TargetType="TextBox">
                <Setter Property="FontWeight" Value="ExtraLight" />
            </Style>

            <Style x:Key="SimpleButton" TargetType="Button">
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="MinWidth" Value="0" />
                <Setter Property="MinHeight" Value="0" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Grid>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="Pressed">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentText" Storyboard.TargetProperty="Opacity">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0.5" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>

                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentText" Storyboard.TargetProperty="Opacity">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="0.5" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Border Background="{TemplateBinding Background}"
                                        BorderThickness="{TemplateBinding BorderThickness}"
                                        Padding="{TemplateBinding Padding}">
                                    <ContentPresenter x:Name="contentText"
                                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                </Border>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="SlimAppBarButtonStyle" TargetType="AppBarButton">
                <Setter Property="VerticalAlignment" Value="Top" />
                <Setter Property="HorizontalAlignment" Value="Left" />
                <Setter Property="FontFamily" Value="Segoe WP" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="AppBarButton">
                            <StackPanel x:Name="LayoutRoot" Background="Transparent">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="ApplicationViewStates">
                                        <VisualState x:Name="FullSize" />
                                        <VisualState x:Name="Compact">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Width">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="48" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="Pressed">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Ellipse" Storyboard.TargetProperty="Stroke">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{TemplateBinding Foreground}" />
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Ellipse" Storyboard.TargetProperty="Fill">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{TemplateBinding Foreground}" />
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemPressedForegroundThemeBrush}" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Ellipse" Storyboard.TargetProperty="Stroke">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemDisabledForegroundThemeBrush}" />
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemDisabledForegroundThemeBrush}" />
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Foreground">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemDisabledForegroundThemeBrush}" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Grid Width="40"
                                      Height="40"
                                      Margin="0"
                                      HorizontalAlignment="Center"
                                      VerticalAlignment="Center">
                                    <Ellipse x:Name="Ellipse"
                                             Width="38"
                                             Height="38"
                                             HorizontalAlignment="Center"
                                             VerticalAlignment="Center"
                                             Fill="{x:Null}"
                                             Stroke="{TemplateBinding Foreground}"
                                             StrokeThickness="2.5"
                                             UseLayoutRounding="False" />
                                    <Grid x:Name="ContentRoot"
                                          HorizontalAlignment="Center"
                                          VerticalAlignment="Center">
                                        <ContentPresenter x:Name="Content"
                                                          Margin="-2,0,0,0"
                                                          HorizontalAlignment="Center"
                                                          VerticalAlignment="Center"
                                                          AutomationProperties.AccessibilityView="Raw"
                                                          Content="{TemplateBinding Icon}"
                                                          Foreground="{TemplateBinding Foreground}" />
                                    </Grid>
                                </Grid>
                                <TextBlock x:Name="TextLabel"
                                           Margin="0"
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center"
                                           FontFamily="{TemplateBinding FontFamily}"
                                           FontSize="9.5"
                                           Foreground="{TemplateBinding Foreground}"
                                           Text="{TemplateBinding Label}"
                                           TextAlignment="Center"
                                           TextWrapping="Wrap" />
                            </StackPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        </ResourceDictionary>
    </Application.Resources>
</caliburn:CaliburnApplication>